package com.ruoyi.paipan.common;

/**
 * @author tiemeng
 * * @date 2024/11/21
 */
public class JieQi {
    private String name;
    private Solar solar;
    private boolean jie;
    private boolean qi;

    public JieQi(String name, Solar solar) {
        setName(name);
        this.solar = solar;
    }

    public void setSolar(Solar solar) {
        this.solar = solar;
    }
    public void setName(String name)
    {
        this.name = name;
        for (int i = 0, j = Lunar.JIE_QI.size(); i < j; i++) {
            if (name.compareTo(Lunar.JIE_QI.get(i)) == 0) {
                if (i % 2 == 0) {
                    this.qi = true;
                } else {
                    this.jie = true;
                }
            }
        }
    }

    public String getName() {
        return name;
    }

    public Solar getSolar() {
        return solar;
    }

    public boolean isJie()
    {
        return this.jie;
    }

    public boolean isQi()
    {
        return this.qi;
    }

    @Override
    public String toString()
    {
        return this.name;
    }

}
